/*
 * Copyright 2022 高国峰
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.alvin.mvvm.help

/**
 * <h3> 作用类描述：对MVP框架进行全局设置 </h3>
 * @ProjectName:    MVVM_Framework
 * @Package:        com.alvin.mvvm.help
 * @ClassName:      ActivityHolder
 * @CreateDate:      2021/8/29 13:51
 * @Description:    通过Build模式全局设置Activity属性
 * @author Alvin
 */
object GlobalMVVMBuilder {
    /**
     * 加载默认的 Activity 设置
     *
     */
    var iSettingBaseActivity: ISettingBaseActivity = DefaultSettingActivity()

    /**
     * 加载默认的 Fragment 设置
     *
     */
    var iSettingBaseFragment: ISettingBaseFragment = DefaultSettingFragment()

    /**
     * 全局初始化
     *
     * @param iSettingBaseActivity 自定义对全局Activity的设置
     */
    fun initSetting(
        iSettingBaseActivity: ISettingBaseActivity = DefaultSettingActivity(),
        iSettingBaseFragment: ISettingBaseFragment = DefaultSettingFragment()
    ) {
        GlobalMVVMBuilder.iSettingBaseActivity = iSettingBaseActivity
        GlobalMVVMBuilder.iSettingBaseFragment = iSettingBaseFragment
    }
}